include(CMakeForceCompiler)

set(CMAKE_SYSTEM_NAME Generic)
#set(CMAKE_SYSTEM_VERSION 1)
#set(CMAKE_SYSTEM_PROCESSOR "arm7")

# specify the cross compiler
cmake_force_c_compiler(arm-elf-gcc-4.6 GNU)
set(CMAKE_ASM_COMPILER arm-elf-as)

# Never lookup programs, or libraries as we are building the kernel itself
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)

set(TOOLCHAIN_ASM_FLAGS  "")
set(TOOLCHAIN_C_FLAGS    "-nostdinc -fno-builtin")
set(TOOLCHAIN_LINK_FLAGS "-nostartfiles")

set(TOOLCHAIN_OBJCOPY arm-elf-objcopy)
set(TOOLCHAIN_AR arm-elf-ar)
set(TOOLCHAIN_RANLIB arm-elf-ranlib)

set(TOOLCHAIN_RT true)
